package com.dz.Mapper;

import com.dz.domain.emp;
import com.dz.domain.loginUserInf;
import com.dz.domain.user;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

@Mapper
public interface userDao {

    public user findById(user us);

    @Select("select count(*) from employee_inf")
    public int userNum();

    @Select("SELECT loginname,username,loginDate FROM user_inf where id=#{id}")
    public user findByIdTwo(int id);

    @Insert("insert into testVue (address,name,age,sex,birth) values (#{address},#{name},#{age},#{sex},#{birth})")
    public int insertUser(emp e);

    @Select("SELECT loginname,password FROM user_inf WHERE loginname = #{loginname} and password = #{password}")
    public user findLoginSys(user us);

    @Select("select * from testvue")
    public List<emp> findTestVueAll();

    @Insert("update user_inf set logindate = #{loginDate} where loginname = #{loginname}")
    public int inLoginDate(String loginname, Date loginDate);
}
